﻿<%@ page title="" language="C#" masterpagefile="~/Site.master" autoeventwireup="true" inherits="EditUsers, MainSite" %>

<asp:Content ID="Content1" ContentPlaceHolderID="BodyContent" runat="Server">

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/qtip2/2.1.1/jquery.qtip.min.css" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/qtip2/2.1.1/jquery.qtip.min.js" type="text/javascript"></script>
    <div class="contentfull">
        <div class="breadcrumbs">
            <ul id="crumbs">
                <li><a title="My Account" href="/account/">My Account</a>
                    <img src="Content/Images/separator.png" alt="&rarr;" class="separator">
                    <a title="Preferences" href="UserManagement.aspx">User Management</a>
                    <img src="Content/Images/separator.png" alt="&rarr;" class="separator">Edit User</li>
            </ul>
        </div>

        <div id="showMessages"></div>


        <div class="top">
            <div class="innerleft">
                <h1>Account</h1>

                <div class="tabs_box">
                    <ul id="tabs">
                        <li><a href="UserAccount.aspx" class="tabs_off">Settings</a></li>
                        <% if (UserObject.RoleId == 1)
                           { %>
                        <li><a href="#" class="tabs_on">User Management</a></li>
                        <%}%>
                        <li><a href="#" class="tabs_off">App Users & Devices</a></li>
                        <li><a href="DeleteAccount.aspx" class="tabs_off">Account Deactivation</a></li>

                    </ul>
                </div>
            </div>
        </div>


        <fieldset>
            <h2>User Management > Edit User</h2>

            <form method="post" action="UserManagement.aspx?mode=edit">
                <div class="content">
                    <input type="hidden" value="<%= Data.Rows[0]["UserId"]%>" name="userid" />
                    <input type="hidden" value="<%= Data.Rows[0]["AppUserName"].ToString() %>" name="username1" />
                    <% if (!string.IsNullOrWhiteSpace(Data.Rows[0]["EmailAdddress"].ToString()))
                       { %>
                    <label for="fname">First Name:</label>
                    <input type="text" class="inputed" name="fname" id="fname" value="<%= Data.Rows[0]["FirstName"].ToString() %>" /><br />
                    <label for="lname">Last Name:</label>
                    <input type="text" class="inputed" name="lname" id="lname" value="<%= Data.Rows[0]["LastName"].ToString() %>" /><br />
                    <label for="phone">Phone Number:</label>
                    <input type="text" class="inputed" name="phone" id="phone" value="<%= Data.Rows[0]["PhoneNumber"].ToString() %>" /><br />
                    <%} %>
                    <label for="username">User Name:</label>
                    <input type="text" class="inputed" name="username" readonly="readonly" disabled="disabled" id="username" value="<%= Data.Rows[0]["AppUserName"].ToString() %>" /><br />
                    <label for="password">Password:</label>
                    <input type="text" class="inputed" name="password" id="password" value="<%= Data.Rows[0]["Password"].ToString() %>" /><br />
                    <label for="usertype">User Type:</label>
                    <input type="text" readonly="readonly" disabled="disabled" class="inputed" name="usertype" id="usertype" value="<%= Data.Rows[0]["UserType"].ToString() %>" /><br />
                    <% if (!string.IsNullOrWhiteSpace(Data.Rows[0]["EmailAdddress"].ToString()))
                       { %>
                    <label for="email">Email:</label>
                    <input type="text" class="inputed" name="email" id="email" value="<%= Data.Rows[0]["EmailAdddress"].ToString() %>" /><br />
                    <%}
                       if (!string.IsNullOrWhiteSpace(Data.Rows[0]["ClientEmail"].ToString()))
                       {%>

                    <label for="client">Administrator Email:</label>
                    <input type="text" readonly="readonly" disabled="disabled" class="inputed" name="client" id="client" value="<%= Data.Rows[0]["ClientEmail"].ToString() %>" /><br />                   
                    <%} %>
                    <label for="ed">Expiry Date:</label>
                    <input class="date" style="width: 100%" name="ed" value="<%= Data.Rows[0]["ExpiryDate"].ToString() %>" type="text" id="expiryDate" /><br />
                     <label for="deviceLimit">User Allowed:</label>
                    <input type="text" class="inputed" name="deviceLimit" id="deviceLimit" value="<%= Data.Rows[0]["DeviceCount"].ToString() %>" /><br />

                    <br />
                    <input type="submit" name="updateAccountButton" value="Update User" class="black_button blarge" />

                    <script type="text/javascript" src="Scripts/jquery.calendrical.js"></script>
                    <script src="https://jquery-json.googlecode.com/files/jquery.json-1.3.min.js"></script>
                    <script>
                        $(document).ready(function () {
                            $('#expiryDate').css("width", $('#password').width());
                            $('#expiryDate').calendricalDateTimeRange({ usa: 1, showFutureOnly: 1 });
                        });
                    </script>
                </div>

            </form>
        </fieldset>
    </div>



</asp:Content>

